import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/ticket_plan_entity.dart';
import 'package:enterprise_v6_app/app/data/common/choice_bean.dart';

import 'package:enterprise_v6_app/app/data/entities/application/execute_entity.dart';


TicketPlanEntity $TicketPlanEntityFromJson(Map<String, dynamic> json) {
  final TicketPlanEntity ticketPlanEntity = TicketPlanEntity();
  final String? applyUserName = jsonConvert.convert<String>(json['applyUserName']);
  if (applyUserName != null) {
    ticketPlanEntity.applyUserName = applyUserName;
  }
  final String? departmentName = jsonConvert.convert<String>(json['departmentName']);
  if (departmentName != null) {
    ticketPlanEntity.departmentName = departmentName;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    ticketPlanEntity.id = id;
  }
  final String? involvedWorkName = jsonConvert.convert<String>(json['involvedWorkName']);
  if (involvedWorkName != null) {
    ticketPlanEntity.involvedWorkName = involvedWorkName;
  }
  final String? planEndDate = jsonConvert.convert<String>(json['planEndDate']);
  if (planEndDate != null) {
    ticketPlanEntity.planEndDate = planEndDate;
  }
  final String? planStartDate = jsonConvert.convert<String>(json['planStartDate']);
  if (planStartDate != null) {
    ticketPlanEntity.planStartDate = planStartDate;
  }
  final String? processTypes = jsonConvert.convert<String>(json['processTypes']);
  if (processTypes != null) {
    ticketPlanEntity.processTypes = processTypes;
  }
  final List<TicketPlanReceiptLists>? receiptLists = (json['receiptLists'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<TicketPlanReceiptLists>(e) as TicketPlanReceiptLists).toList();
  if (receiptLists != null) {
    ticketPlanEntity.receiptLists = receiptLists;
  }
  final String? ticketAddress = jsonConvert.convert<String>(json['ticketAddress']);
  if (ticketAddress != null) {
    ticketPlanEntity.ticketAddress = ticketAddress;
  }
  final String? ticketContent = jsonConvert.convert<String>(json['ticketContent']);
  if (ticketContent != null) {
    ticketPlanEntity.ticketContent = ticketContent;
  }
  final String? ticketName = jsonConvert.convert<String>(json['ticketName']);
  if (ticketName != null) {
    ticketPlanEntity.ticketName = ticketName;
  }
  final String? ticketNo = jsonConvert.convert<String>(json['ticketNo']);
  if (ticketNo != null) {
    ticketPlanEntity.ticketNo = ticketNo;
  }
  final String? ticketSource = jsonConvert.convert<String>(json['ticketSource']);
  if (ticketSource != null) {
    ticketPlanEntity.ticketSource = ticketSource;
  }
  final String? applyDepartmentId = jsonConvert.convert<String>(json['applyDepartmentId']);
  if (applyDepartmentId != null) {
    ticketPlanEntity.applyDepartmentId = applyDepartmentId;
  }
  final String? applyDepartmentName = jsonConvert.convert<String>(json['applyDepartmentName']);
  if (applyDepartmentName != null) {
    ticketPlanEntity.applyDepartmentName = applyDepartmentName;
  }
  final List<String>? ticketIdentityId = (json['ticketIdentityId'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<String>(e) as String).toList();
  if (ticketIdentityId != null) {
    ticketPlanEntity.ticketIdentityId = ticketIdentityId;
  }
  final String? ticketIdentityName = jsonConvert.convert<String>(json['ticketIdentityName']);
  if (ticketIdentityName != null) {
    ticketPlanEntity.ticketIdentityName = ticketIdentityName;
  }
  final String? identityUserId = jsonConvert.convert<String>(json['identityUserId']);
  if (identityUserId != null) {
    ticketPlanEntity.identityUserId = identityUserId;
  }
  return ticketPlanEntity;
}

Map<String, dynamic> $TicketPlanEntityToJson(TicketPlanEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['applyUserName'] = entity.applyUserName;
  data['departmentName'] = entity.departmentName;
  data['id'] = entity.id;
  data['involvedWorkName'] = entity.involvedWorkName;
  data['planEndDate'] = entity.planEndDate;
  data['planStartDate'] = entity.planStartDate;
  data['processTypes'] = entity.processTypes;
  data['receiptLists'] = entity.receiptLists?.map((v) => v.toJson()).toList();
  data['ticketAddress'] = entity.ticketAddress;
  data['ticketContent'] = entity.ticketContent;
  data['ticketName'] = entity.ticketName;
  data['ticketNo'] = entity.ticketNo;
  data['ticketSource'] = entity.ticketSource;
  data['applyDepartmentId'] = entity.applyDepartmentId;
  data['applyDepartmentName'] = entity.applyDepartmentName;
  data['ticketIdentityId'] = entity.ticketIdentityId;
  data['ticketIdentityName'] = entity.ticketIdentityName;
  data['identityUserId'] = entity.identityUserId;
  return data;
}

extension TicketPlanEntityExtension on TicketPlanEntity {
  TicketPlanEntity copyWith({
    String? applyUserName,
    String? departmentName,
    String? id,
    String? involvedWorkName,
    String? planEndDate,
    String? planStartDate,
    String? processTypes,
    List<TicketPlanReceiptLists>? receiptLists,
    String? ticketAddress,
    String? ticketContent,
    String? ticketName,
    String? ticketNo,
    String? ticketSource,
    String? applyDepartmentId,
    String? applyDepartmentName,
    List<String>? ticketIdentityId,
    String? ticketIdentityName,
    String? identityUserId,
  }) {
    return TicketPlanEntity()
      ..applyUserName = applyUserName ?? this.applyUserName
      ..departmentName = departmentName ?? this.departmentName
      ..id = id ?? this.id
      ..involvedWorkName = involvedWorkName ?? this.involvedWorkName
      ..planEndDate = planEndDate ?? this.planEndDate
      ..planStartDate = planStartDate ?? this.planStartDate
      ..processTypes = processTypes ?? this.processTypes
      ..receiptLists = receiptLists ?? this.receiptLists
      ..ticketAddress = ticketAddress ?? this.ticketAddress
      ..ticketContent = ticketContent ?? this.ticketContent
      ..ticketName = ticketName ?? this.ticketName
      ..ticketNo = ticketNo ?? this.ticketNo
      ..ticketSource = ticketSource ?? this.ticketSource
      ..applyDepartmentId = applyDepartmentId ?? this.applyDepartmentId
      ..applyDepartmentName = applyDepartmentName ?? this.applyDepartmentName
      ..ticketIdentityId = ticketIdentityId ?? this.ticketIdentityId
      ..ticketIdentityName = ticketIdentityName ?? this.ticketIdentityName
      ..identityUserId = identityUserId ?? this.identityUserId;
  }
}

TicketPlanReceiptLists $TicketPlanReceiptListsFromJson(Map<String, dynamic> json) {
  final TicketPlanReceiptLists ticketPlanReceiptLists = TicketPlanReceiptLists();
  final String? applyUserName = jsonConvert.convert<String>(json['applyUserName']);
  if (applyUserName != null) {
    ticketPlanReceiptLists.applyUserName = applyUserName;
  }
  final String? applyUserId = jsonConvert.convert<String>(json['applyUserId']);
  if (applyUserId != null) {
    ticketPlanReceiptLists.applyUserId = applyUserId;
  }
  final String? endDate = jsonConvert.convert<String>(json['endDate']);
  if (endDate != null) {
    ticketPlanReceiptLists.endDate = endDate;
  }
  final List<ExecuteTicketReceiptListOperatorLists>? guardianList = (json['guardianList'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<ExecuteTicketReceiptListOperatorLists>(e) as ExecuteTicketReceiptListOperatorLists).toList();
  if (guardianList != null) {
    ticketPlanReceiptLists.guardianList = guardianList;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    ticketPlanReceiptLists.id = id;
  }
  final String? planEndDate = jsonConvert.convert<String>(json['planEndDate']);
  if (planEndDate != null) {
    ticketPlanReceiptLists.planEndDate = planEndDate;
  }
  final String? planStartDate = jsonConvert.convert<String>(json['planStartDate']);
  if (planStartDate != null) {
    ticketPlanReceiptLists.planStartDate = planStartDate;
  }
  final String? startDate = jsonConvert.convert<String>(json['startDate']);
  if (startDate != null) {
    ticketPlanReceiptLists.startDate = startDate;
  }
  final String? ticketBigTypeName = jsonConvert.convert<String>(json['ticketBigTypeName']);
  if (ticketBigTypeName != null) {
    ticketPlanReceiptLists.ticketBigTypeName = ticketBigTypeName;
  }
  final String? ticketPlanId = jsonConvert.convert<String>(json['ticketPlanId']);
  if (ticketPlanId != null) {
    ticketPlanReceiptLists.ticketPlanId = ticketPlanId;
  }
  final int? type = jsonConvert.convert<int>(json['type']);
  if (type != null) {
    ticketPlanReceiptLists.type = type;
  }
  final String? processEncoding = jsonConvert.convert<String>(json['processEncoding']);
  if (processEncoding != null) {
    ticketPlanReceiptLists.processEncoding = processEncoding;
  }
  final int? isChange = jsonConvert.convert<int>(json['isChange']);
  if (isChange != null) {
    ticketPlanReceiptLists.isChange = isChange;
  }
  final int? liveStatus = jsonConvert.convert<int>(json['liveStatus']);
  if (liveStatus != null) {
    ticketPlanReceiptLists.liveStatus = liveStatus;
  }
  return ticketPlanReceiptLists;
}

Map<String, dynamic> $TicketPlanReceiptListsToJson(TicketPlanReceiptLists entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['applyUserName'] = entity.applyUserName;
  data['applyUserId'] = entity.applyUserId;
  data['endDate'] = entity.endDate;
  data['guardianList'] = entity.guardianList.map((v) => v.toJson()).toList();
  data['id'] = entity.id;
  data['planEndDate'] = entity.planEndDate;
  data['planStartDate'] = entity.planStartDate;
  data['startDate'] = entity.startDate;
  data['ticketBigTypeName'] = entity.ticketBigTypeName;
  data['ticketPlanId'] = entity.ticketPlanId;
  data['type'] = entity.type;
  data['processEncoding'] = entity.processEncoding;
  data['isChange'] = entity.isChange;
  data['liveStatus'] = entity.liveStatus;
  return data;
}

extension TicketPlanReceiptListsExtension on TicketPlanReceiptLists {
  TicketPlanReceiptLists copyWith({
    String? applyUserName,
    String? applyUserId,
    String? endDate,
    List<ExecuteTicketReceiptListOperatorLists>? guardianList,
    String? id,
    String? planEndDate,
    String? planStartDate,
    String? startDate,
    String? ticketBigTypeName,
    String? ticketPlanId,
    int? type,
    String? processEncoding,
    int? isChange,
    int? liveStatus,
  }) {
    return TicketPlanReceiptLists()
      ..applyUserName = applyUserName ?? this.applyUserName
      ..applyUserId = applyUserId ?? this.applyUserId
      ..endDate = endDate ?? this.endDate
      ..guardianList = guardianList ?? this.guardianList
      ..id = id ?? this.id
      ..planEndDate = planEndDate ?? this.planEndDate
      ..planStartDate = planStartDate ?? this.planStartDate
      ..startDate = startDate ?? this.startDate
      ..ticketBigTypeName = ticketBigTypeName ?? this.ticketBigTypeName
      ..ticketPlanId = ticketPlanId ?? this.ticketPlanId
      ..type = type ?? this.type
      ..processEncoding = processEncoding ?? this.processEncoding
      ..isChange = isChange ?? this.isChange
      ..liveStatus = liveStatus ?? this.liveStatus;
  }
}
